package org.ds.blog.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.ds.blog.model.Article;

import java.util.List;

@Mapper
public interface ArticleMapper {
    Article getArticleById(Integer articleId);

    List<Article> getAllArticles();

    List<Article> getArticleByState(Integer state,Integer userId,String title);

    Integer addArticle(Article article);

    Integer deleteArticle(Integer []articleIds);

    Integer updateArticleState(Integer []articleIds,Integer state);

    Integer updateArticleStateById(Integer articleId,Integer state);

    Integer updateArticle(Article article);

    Integer addTags(String []tags);

    Integer deleteTagsByArticleId(Integer articleId);

    List<Integer> getTagIdsByTagNames(String[] tagNames);

    Integer addTagIdsAndArticleId(List<Integer> tagIds,Integer articleId);
}
